<!DOCTYPE html>
<html>
<head>
    <title>第一章 软件下载安装配置</title>

    <meta charset="UTF-8"/>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>

    <meta name="HandheldFriendly" content="true"/>

    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>

    <meta name="apple-mobile-web-app-capable" content="yes"/>

    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>

    <link href="./asset/farbox/basic.css" type="text/css" rel="stylesheet"/>
    <link href="./asset/farbox/main.css" type="text/css" rel="stylesheet"/>

    <style type="text/css">
        
            span.md_line{margin-bottom:0.5em; display:block; line-height:1.89}
            .md_line br{ display: none;}
            
    </style>

    <script>
        var flowchat_options = {
            'x': 0, 'y': 0, 'line-width': 1, 'line-length': 50, 'text-margin': 10, 'font-size': 13,
            'font-color': '#3c3c3c', 'line-color': '#666666', 'element-color': '#666666', 'fill': 'transparent',
            'yes-text': 'yes', 'no-text': 'no', 'arrow-end': 'block', 'class': 'flowchart', 'scale': 1,
            'symbols': { 'start': {}, 'end': {}, 'condition': {}, 'inputoutput': {}, 'operation': {}, 'subroutine': {}}
        }
    </script>
    <script type="text/javascript" src="./asset/other/raphael-min.js"></script>
    <script type="text/javascript" src="./asset/other/flowchart.js"></script>
    <script type="text/javascript" src="./asset/other/echarts.min.js"></script>


</head>

<body>
    
        <a href="./index.html" id="go_to_home"> &lt; home </a>
    
    <div id="sidebar">
        <ul id="sidebar_body">
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./001.软件下载安装配置.html" class="selected">第一章 软件下载安装配置</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./002.数据库操作.html" class="">002.数据库操作</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./003.数据表操作.html" class="">003.数据表操作</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./004.PHP与sql server连接.html" class="">004.PHP与sql server连接</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./005.数据的增删改.html" class="">005.数据的增删改</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./006.数据操作-简单查询.html" class="">006.数据操作-简单查询</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./007.高级查询.html" class="">07.高级查询-排序 多表联合 聚合与分组 限制条数</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./008.多表连接查询.html" class="">08.多表连接查询</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./009.子查询 ANY ALL [NOT] IN [NOT]EXISTS.html" class="">09.子查询 ANY ALL [NOT] IN [NOT]EXISTS</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./010.事务-索引-视图.html" class="">010.事务-索引-视图</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./011.T-SQL.html" class="">011.T-SQL学习</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./012.存储过程.html" class="">012.存储过程</a>
                </li>
            

            
        
            
            
            
            

            
                <li class="level_1 file">
                    <a href="./013.触发器.html" class="">10.触发器</a>
                </li>
            

            
        
        </ul>
    </div>

    <div id="main">
        <div class="content_body">
            <h1 class="title"> 第一章 软件下载安装配置 </h1>
            <div class="doc_post"> <p class="md_block">

<div class="toc"><ul>
<li>
<a href="#toc_0">第一章 软件下载安装配置</a>
<ul>
<li>
<a href="#toc_1">下载sql server 与管理工具 SQL Server Management Studio</a>
</li>
<li>
<a href="#toc_2">安装sql server</a>
</li>
<li>
<a href="#toc_3">安装SQL Server Management Studio</a>
</li>
<li>
<a href="#toc_4">配置sql server</a>
</li>
<li>
<a href="#toc_5">使用SQL Server Management Studio登陆到本机实例</a>
</li>
<li>
<a href="#toc_6">SQL Server 2008 Windows身份验证改为混合模式身份验证</a>
</li>
</ul>
</li>
</ul>
</div>
</p>


<h2 id="toc_1">下载sql server 与管理工具 SQL Server Management Studio</h2>

<p class="md_block">
    <span class="md_line md_line_dom_embed"><a class="md_compiled" href="https://www.microsoft.com/zh-CN/download/details.aspx?id=3743">点击去下载:https://www.microsoft.com/zh-CN/download/details.aspx?id=3743</a><br /></span>
    <span class="md_line md_line_dom_embed"><a class="md_compiled" href="https://www.microsoft.com/zh-cn/download/details.aspx?id=7593">点击去下载:https://www.microsoft.com/zh-cn/download/details.aspx?id=7593</a></span>
</p>


<h2 id="toc_2">安装sql server</h2>

<p class="md_block">
    <span class="md_line">演示与指导完成.</span>
</p>


<h2 id="toc_3">安装SQL Server Management Studio</h2>

<p class="md_block">
    <span class="md_line">演示与指导完成.</span>
</p>


<h2 id="toc_4">配置sql server</h2>

<p class="md_block md_has_block_below md_has_block_below_blockquote">
    <span class="md_line">操作系统开始菜单 -&gt; 所有程序 -&gt; Microsoft SQL Server 2008 R2-&gt;配置工具 -&gt; SQL Server 配置管理器<br /></span>
    <span class="md_line">1.启用网络协议<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-33-29.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-33-29.jpg" alt="" title="" ><br /></span>
    <span class="md_line">2.启用后在TCP/IP上再次鼠标右键 -&gt; 属性 -&gt;IP地址(选项卡)-&gt;拉滚动条到最下 -&gt;改TCP动态端口为 1433</span>
</p>


<blockquote>

<p class="md_block">
    <span class="md_line">注意操作系统防火墙.要设置入站规则1433端口为允许.</span>
</p>

</blockquote>

<p class="md_block">
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-34-55.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-34-55.jpg" alt="" title="" ><br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-37-38.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-37-38.jpg" alt="" title="" ><br /></span>
    <span class="md_line">3.完成后记得重启SQL SERVER(EXPRESS)的服务<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-39-42.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-39-42.jpg" alt="" title="" ><br /></span>
    <span class="md_line">4.查看服务状态<br /></span>
    <span class="md_line">4.1可以运行services.msc中去看服务进程的情况(如下图)<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-44-17.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-44-17.jpg" alt="" title="" ><br /></span>
    <span class="md_line">4.2可以查看本机网络端品状况,运行 netstat -ano<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-45-58.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-45-58.jpg" alt="" title="" ><br /></span>
    <span class="md_line">4.3  也可以运行 telnet 127.0.0.1 1433  看端口是否成功打开.</span>
</p>


<p class="md_block">
    <span class="md_line">4.4 以后也可以命令来启动与停止sql服务.</span>
</p>

<div class="codehilite code_lang_shell  highlight"><pre><span></span><span class="c1">#启动: </span>
net start <span class="s2">&quot;sql server (sqlexpress)&quot;</span>
<span class="c1">#停止:</span>
net stop <span class="s2">&quot;sql server (sqlexpress)&quot;</span>
</pre></div>

<!--block_code_end-->
<h2 id="toc_5">使用SQL Server Management Studio登陆到本机实例</h2>

<p class="md_block md_has_block_below md_has_block_below_blockquote">
    <span class="md_line">要确保sql server(sqlexpress)服务是运行了.<br /></span>
    <span class="md_line">操作系统开始菜单 -&gt; 所有程序 -&gt; Microsoft SQL Server 2008 -&gt; SQL Server Management Studio<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-19-53-18.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-19-53-18.jpg" alt="" title="" ><br /></span>
    <span class="md_line">服务器名称: 可以用: <br /></span>
    <span class="md_line">    (local)   .   (点符号)  表示机默认实列; 也可以用网络登陆:如  127.0.0.1 localhos 真实IP等.<br /></span>
    <span class="md_line">身份验证:SQL Server 身份验证; <br /></span>
    <span class="md_line">登陆名: sa<br /></span>
    <span class="md_line">密码:安装时设置的密码</span>
</p>


<blockquote>

<p class="md_block">
    <span class="md_line">注意:如果安装时没有选登陆模式为 SQL Server 2008 Windows身份验证改为混合模式身份验证  则进行如下操作:</span>
</p>

</blockquote>

<h2 id="toc_6">SQL Server 2008 Windows身份验证改为混合模式身份验证</h2>

<p class="md_block">
    <span class="md_line">1、用Windows身份验证方式进入SQL2008，如下图：<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/484e35b86a89ea9bc2f2f56d4cd9662f_SouthEast.png';this.onerror=null;"  class="" src="/_image/484e35b86a89ea9bc2f2f56d4cd9662f_SouthEast.png" alt="" title="" ><br /></span>
    <span class="md_line">点击连接，如果出现错误<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/85d40c8c12fe002b8669b59c0f48af46_SouthEast.png';this.onerror=null;"  class="" src="/_image/85d40c8c12fe002b8669b59c0f48af46_SouthEast.png" alt="" title="" ><br /></span>
    <span class="md_line">首先，我们应该想到的是，Sqlserver2008的服务没有开启，我们开启服务后重新连接，问题解决。<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/f4a01b50a29a198af336479e4d55802d_SouthEast.png';this.onerror=null;"  class="" src="/_image/f4a01b50a29a198af336479e4d55802d_SouthEast.png" alt="" title="" ><br /></span>
    <span class="md_line">在“对象资源管理器”右击根目录，弹出服务器属性。<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/aef50e6531ccff3c3212d3ad880f82d6_SouthEast.png';this.onerror=null;"  class="" src="/_image/aef50e6531ccff3c3212d3ad880f82d6_SouthEast.png" alt="" title="" ><br /></span>
    <span class="md_line">在“选择页”-&gt;“安全性”-&gt;勾选Sql Server和Windows身份验证模式-&gt;确定。到这里就可以断开连接退出并使用“SQL Server身份验证”模式登录了。<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/22c5a955aa374a48915d855060b522ed_SouthEast.png';this.onerror=null;"  class="" src="/_image/22c5a955aa374a48915d855060b522ed_SouthEast.png" alt="" title="" ><br /></span>
    <span class="md_line">由于默认不启用sa，所以如果启用sa账户登录，则还需要如下设置:<br /></span>
    <span class="md_line">2、回到“对象资源管理器”，展开“安全性”，展开“登录名”就会看到登录名sa，右键它--&gt;属性，“选择页”上选“状态”，右边的登陆选“启用”。确定。</span>
</p>


<p class="md_block">
    <span class="md_line">这样就可以用sa登录，密码默认为空<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/c711495f1595e3842aa2238dbbd7fb68_SouthEast.png';this.onerror=null;"  class="" src="/_image/c711495f1595e3842aa2238dbbd7fb68_SouthEast.png" alt="" title="" ><br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/9bacc8609b0811f0afb0096dbd2ea1f7_SouthEast.png';this.onerror=null;"  class="" src="/_image/9bacc8609b0811f0afb0096dbd2ea1f7_SouthEast.png" alt="" title="" ></span>
</p>


<p class="md_block">
    <span class="md_line">3、若要修sa密码，有两种方法，个人推荐方法1，简单明了，操作如下：<br /></span>
    <span class="md_line md_line_dom_embed"><img onerror="this.src='../_image/2019-10-30-20-03-36.jpg';this.onerror=null;"  class="" src="/_image/2019-10-30-20-03-36.jpg" alt="" title="" ></span>
</p> </div>
        </div>

    </div>





<script>
    // auto focus for menu
    window.onload = function(){
        var sidebar = document.getElementById('sidebar');
        var current = document.getElementsByClassName('selected')[0];
        if (current && sidebar){
            sidebar.scrollTop = current.offsetTop - sidebar.clientHeight/2 + 100
        }
    };
</script>




</body>

</html>